home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / lib / sendmail.cf.z / sendmail.cf
Text File  |  1992-04-03  |  29KB  |  967 lines

  1. ############################################################
  2. ############################################################
  3. #####
  4. #####        SENDMAIL CONFIGURATION FILE
  5. #####
  6. ############################################################
  7. ############################################################
  8. #  Copyright (c) 1983 Regents of the University of California.
  9. #  All rights reserved.  The Berkeley software License Agreement
  10. #  specifies the terms and conditions for redistribution.
  11. #
  12. #
  13. # To install this file:
  14. #
  15. # 1) You MUST define the D, F, and T macros and/or classes appropriately:
  16. #
  17. #    D macro and class (local (D)omain name)
  18. #        The D macro defines the local domain name.
  19. #        Define this macro to contain the name of the domain in
  20. #        which this host resides.  If no domains are used, you
  21. #        should make sure that this macro is left empty or comment
  22. #        it out.
  23. #
  24. #        The D class explicitly lists all domains to which this
  25. #        host should send mail directly via the ethernet mailer.
  26. #
  27. #        Mail destined for domains not listed in the D class will
  28. #        be sent via an exchanger, or relay host associated
  29. #        with the destination host in preference to sending it
  30. #        directly to the recipient host.
  31. #
  32. #        Mail destined for domains listed in the D class will be
  33. #        sent directly to the destination host if possible.  No
  34. #        attempt will be made to send the mail via an exchanger,
  35. #        or relay host.
  36. #
  37. #        If this host is a relay or exchanger for a particular
  38. #        domain, that domain should appear in the D class.
  39. #
  40. #        If this host is not an exchanger or relay, this class
  41. #        may be left empty.
  42. #
  43. #    F macro and class ((F)orwarder hostname)
  44. #        The F macro defines the name or alias of the host to which
  45. #        this host will send all mail to unknown hosts or domains.
  46. #        It is strongly suggested that the F macro contiain the
  47. #        fully qualified domain name (FQDN) of the forwarder host.
  48. #
  49. #        The F class contains all known names for the host defined
  50. #        in the F macro.
  51. #
  52. #        Mail will only sent to the forwarder as a last resort in
  53. #        the event that:
  54. #
  55. #            a) this host cannot canonicalize the destination
  56. #               hostname or determine an appropriate relay or mail
  57. #               exchanger to deal with it.
  58. #
  59. #            - or -
  60. #
  61. #            b) the appropriate host or relay or exchanger
  62. #               to which this host will be sending the message
  63. #               turns out to exist outside of the top level
  64. #               domain (see the T macro below).
  65. #
  66. #        If no such host exists, the F macro and class should be
  67. #        left empty.  If this host is the forwarder host, the F macro
  68. #        should contain this host's full hostname while the F class
  69. #        should contain all known names for this host.
  70. #
  71. #        In the event that this host is the forwarder host and one
  72. #        of the above conditions for sending mail on to the forwarder
  73. #        host is met, this host will put messages to unknown hosts or
  74. #        domains out "on the wire" and hope for the best.
  75. #
  76. #    T macro ((T)op level domain)
  77. #        This macro defines the name of the top level of the local
  78. #        domain space.  For example, if this host resides in
  79. #        some subdomain BAR.FOO.COM under the FOO.COM domain, and
  80. #        if all hosts under the FOO.COM domain or any subdomain
  81. #        under the FOO.COM domain are to be considered internal
  82. #        hosts, you would define the T macro to be FOO.COM.
  83. #
  84. #        The top level domain is used in conjunction with the
  85. #        definition of the forwarder host defined in the F macro
  86. #        and class above.  All mail destined to hosts "outside" the
  87. #        top level domain will be sent via the forwarder host.
  88. #
  89. #
  90. # 2) It MAY be necessary to define the K class and/or P macro.
  91. #
  92. #    K class ((K)illed hosts in the local domain)
  93. #        This class is a list of all known "killed" or "dead" hosts
  94. #        in the local domain.  This list is generally used by relay
  95. #        or exchanger machines to detect mail to no-longer-existent
  96. #        hosts.  Mail to such hosts will be redirected to the
  97. #        forwarder machine (defined in the F macro above).
  98. #
  99. #    P macro ((P)athalias database)
  100. #        This macro defines the location of the pathalias database.
  101. #
  102. # 3) Review the rules preceded by the "??? unusual rule" comment.
  103.  
  104.  
  105. #####################################
  106. # Parameters which MUST be defined. #
  107. #####################################
  108.  
  109. #### D macro and class #####################################################
  110. # D macro: Our full local domain name.
  111. # If domains are not used, delete or comment out this line.
  112. DD BAR.FOO.COM
  113.  
  114. # D class: Domains into which we should send mail directly.
  115. # Explicit list of all domains into which we can and should send mail
  116. # directly (without the use of any forwarder, relay, or exchanger hosts.)
  117. # If this host is a relay or exchanger for a particular domain, that domain
  118. # should be listed here, otherwise this class may be left empty.
  119. CD
  120.  
  121. #### F macro and class #####################################################
  122. # F macro: Forwarder hostname.
  123. # The F macro must contain the name of the forwarder host.
  124. # If no such host exists this macro should be empty.  If this host is the
  125. # forwarder, this macro should be defined to contain this host's name.
  126. DF FORWARDHOST.BAR.FOO.COM
  127.  
  128. # F class: Alternate forwarder hostnames.
  129. # The F class should contain all known hostnames for the forwarder host
  130. # defined above.  If the F macro is empty, the F class should be empty as
  131. # well.
  132. CF FORWARDHOST.BAR.FOO.COM FORWARDHOST
  133.  
  134. #### T macro and class #####################################################
  135. # T macro: Our top-level domain name.
  136. # Defines the top level of our local domain space.  Mail to any machines
  137. # which exist in this domain or any sub-domain under this domain will be
  138. # considered local or internal (as opposed to foreign).  It will be
  139. # considered O.K. to query for relay hosts in this domain or any sub-domain
  140. # under this domain.
  141. #
  142. # Mail to any machine which does not exist in this domain or any sub-domain
  143. # under this domain will be sent to the forwarder host (defined above) for
  144. # further disposition.
  145. #
  146. # If you do not use domain addressing, this macro should be left blank.
  147. DT FOO.COM
  148.  
  149.  
  150. ############################################
  151. # Parameters which MAY need to be defined. #
  152. ############################################
  153.  
  154. #### K class ###############################################################
  155. # Killed machines within the local domain:  These machines have been
  156. # permanently turned off.  All mail for them should be redirected to the
  157. # forwarder.  This class is used by domain forwarders to redirect mail
  158. # to known bad, dead, renamed, etc. hosts.  This class only needs to be
  159. # defined on domain forwarders.
  160. #
  161. # Note that this class can be defined inline via the CK command and/or
  162. # may be read from the sendmail.killed file.
  163. #CK BADHOST DEADHOST
  164. #FK/usr/lib/sendmail.killed
  165.  
  166. # Additionally for the K class...
  167. # Many machines generate UUCP return paths which include '!somewhere!' 
  168. # when they get confused.  It is a good idea to make sure that your
  169. # K class contains at least 'somewhere'.
  170. CKsomewhere
  171.  
  172. #### P macro ###############################################################
  173. # Look here for path-alias database.
  174. #DP/dev/null
  175. #DP/usr/lib/news/maps/palias
  176.  
  177.  
  178. #############################################################
  179. # Other Parameters which come pre-configured and SHOULD NOT #
  180. # need to be redefined.                                     #
  181. #############################################################
  182.  
  183. # Official hostname
  184. Dj$w
  185.  
  186. # R macro: Relay hostname.
  187. # This macro defines the hostname (or an alias) used by
  188. # all hosts which act as relay machines.  Relay machines
  189. # are "forwarders" to known internal domains and are themselves
  190. # defined by the use of this relay hostname as their hostname
  191. # or alias.
  192. #
  193. # This macro comes pre-configured as "relay" which is strongly
  194. # suggested.
  195. #
  196. # This macro must not be left blank although it is not necessary
  197. # for any actual relay machines to be configured in the
  198. # network.
  199. #
  200. # Mail relay hosts implement a sort of "poor man's" MX scheme.
  201. # They may also be useful as an emergency "back-up" to the use
  202. # of MX records.
  203. DRrelay
  204.  
  205. # T class: Our top-level domain name.
  206. # Must be identical to the definition of the T macro above or all hell
  207. # will break loose.  Defined via the T macro, do not touch!
  208. CT $T
  209.  
  210. # V class: UUCP machines
  211. # This class is the list of all machines to which we can send mail
  212. # via UUCP
  213. FV/usr/lib/uucp/Systems %[-_a-zA-Z0-9]
  214.  
  215. # N class: UUCP machines that understand domains
  216. # This class is the list of all machines to which we can send mail
  217. # via UUCP and which understand domain-style addressing.  We don't
  218. # need to rewrite addresses into uucp-style when mailing to these
  219. # machines.
  220. FN/usr/lib/uucp/Systems #domain-machine %s
  221.  
  222.  
  223. ######################
  224. ### Version Number ###
  225. ######################
  226.  
  227. DZ911001.SGI
  228.  
  229. ###########################
  230. ## Used for lookup logic ##
  231. ###########################
  232.  
  233. DYFAIL
  234. CY $Y
  235.  
  236. ##########################
  237. ##### Special macros #####
  238. ##########################
  239.  
  240. # my name
  241. DnMAILER-DAEMON
  242.  
  243. # UNIX header format
  244. DlFrom $g  $d
  245.  
  246. # delimiter (operator) characters
  247. Do.:%@!^=/[]
  248.  
  249. # format of a total name
  250. Dq$g$?x ($x)$.
  251.  
  252. # SMTP login message
  253. De$j Sendmail $v/$Z ready at $b
  254.  
  255.  
  256. ###################
  257. ###   Options   ###
  258. ###################
  259.  
  260. # location of local alias file
  261. OA/usr/lib/aliases
  262.  
  263. # wait up to x (originally ten) minutes for alias file rebuild
  264. Oa9
  265.  
  266. # substitution for space (blank) characters
  267. OB.
  268.  
  269. # (don't) connect to "expensive" mailers
  270. #Oc
  271.  
  272. # default delivery mode (deliver in background)
  273. Odbackground
  274. #Odqueue
  275.  
  276. # temporary file mode
  277. OF0600
  278.  
  279. # default UID
  280. Ou998
  281.  
  282. # default GID
  283. Og998
  284.  
  285. # location of help file
  286. OH/usr/lib/sendmail.hf
  287.  
  288. # log level;  1 is usually right--9 is nice for debugging
  289. OL3
  290.  
  291. # default network name
  292. ON$D
  293.  
  294. # default messages to old style
  295. Oo
  296. # queue directory
  297. OQ/usr/spool/mqueue
  298. # read timeout -- violates protocols
  299. Or2h
  300. # status file
  301. OS/usr/lib/sendmail.st
  302. # queue up everything before starting transmission
  303. Os
  304. # default timeout interval
  305. OT7d
  306. # time zone names (V6 only)
  307. # wizard's password
  308. OW*
  309. # load average at which we just queue messages
  310. Ox20
  311. # load average at which we refuse connections
  312. OX25
  313. # rebuild alias file
  314. OD
  315.  
  316. # ??? unusual rule
  317. # Define NIS mail.byaddr (reverse alias) file.
  318. # Also see ruleset 11 below for use of this database.
  319. #OKA%mail.byaddr
  320.  
  321. ###############################
  322. ###   Message precedences   ###
  323. ###############################
  324.  
  325. Pfirst-class=0
  326. Pspecial-delivery=100
  327. Pbulk=-60
  328. Pjunk=-100
  329.  
  330. #########################
  331. ###   Trusted users   ###
  332. #########################
  333.  
  334. Troot
  335. Tdaemon
  336. Tuucp
  337. Tuucpadm
  338.  
  339. #############################
  340. ###   Format of headers   ###
  341. #############################
  342.  
  343. HReceived: $?sfrom $s $.by $j $?rvia $r $.($v/$Z)
  344.     $?ufor $u$. id $i; $b
  345. H?P?Return-Path: <$g>
  346. H?D?Resent-Date: $a
  347. H?D?Date: $a
  348. H?F?Resent-From: $q
  349. H?F?From: $q
  350. H?x?Full-Name: $x
  351. HSubject:
  352. # HPosted-Date: $a
  353. # H?l?Received-Date: $b
  354. H?M?Resent-Message-Id: <$t.$i@$j>
  355. H?M?Message-Id: <$t.$i@$j>
  356. # H?R?Return-Receipt-To: $g
  357.  
  358.  
  359. ###########################
  360. ###   Rewriting rules   ###
  361. ###########################
  362.  
  363.  
  364. #############################################################
  365. # insert this handy debugging line wherever you have problems
  366. #R$*                $:$>99$1
  367.  
  368. ######################################
  369. #  Debugging ruleset - Leave empty.  #
  370. ######################################
  371. S99
  372.  
  373. ################################
  374. #  Sender Field Pre-rewriting  #
  375. ################################
  376. S1
  377.  
  378. ###################################
  379. #  Recipient Field Pre-rewriting  #
  380. ###################################
  381. S2
  382.  
  383. #################################
  384. #  Final Output Post-rewriting  #
  385. #################################
  386. S4
  387.  
  388. R@            $@                handle <> error addr
  389.  
  390. # convert mixed UUCP and domains into UUCP
  391. #    but only in some simple cases where it is not wrong
  392. R$+!$+<@$*>        $:$>5$1!$2<@$3>
  393.  
  394. R$*<$+>$*        $1$2$3                defocus
  395. R@$+:@$+:$+        @$1,@$2:$3            <route-addr> canonical
  396.  
  397.  
  398.  
  399. ###########################
  400. #  Name Canonicalization  #
  401. ###########################
  402. S3
  403.  
  404. # handle "from:<>" special case
  405. R<>            $@@                turn into magic token
  406.  
  407. # basic textual canonicalization -- note RFC733 heuristic here
  408. R$*<$*<$*<$+>$*>$*>$*    $4                3-level <> nesting
  409. R$*<$*<$+>$*>$*        $3                2-level <> nesting
  410. R$*<$+>$*        $2                basic RFC821/822 parsing
  411. #R$+ at $+        $1@$2                "at"->"@" for RFC 822
  412.  
  413. R$j!$+            $1                strip our host name
  414. R$=w!$+            $2                even if it has dots
  415. R$=w.$D!$+        $2
  416.  
  417. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  418. R@$+,@$+        @$1:@$2                change all "," to ":"
  419.  
  420. # localize and dispose of route-based addresses
  421. R@$+:$+            $@<@$1>:$2            handle <route-addr>
  422.  
  423. # more miscellaneous cleanup
  424. R$+:$*;@$+        $@$1:$2;@$3            list syntax
  425. R$+:$*;            $@$1:$2;            list syntax
  426. R$*@$+            $:$1<@$2>            focus on domain
  427. R$*<$+@$+>        $1$2<@$3>            move gaze right
  428. R$*<@$+>        $@$1<@$2>            already canonical
  429.  
  430. # convert old-style addresses to a domain-based address
  431. R$-:$+            $@$2<@$1>            host:user
  432. R$+^$+            $1!$2                convert ^ to !
  433. R$-.$+!$+        $@$3<@$1.$2>            host.domain!user
  434. R$-!$+            $@$2<@$1>            host!user (uucp)
  435. R$+%$+            $:$1<@$2>            user%host
  436. R$+<@$+%$+>        $1%$2<@$3>            move gaze right
  437. R$*<@$+>        $@$1<@$2>            now % is canonical
  438. R$-=$+            $@$2<@$1.BITNET>        host=user (bitnet)
  439. #R$-.$+            $@$2<@$1>            host.user (? XXX ?)
  440.  
  441.  
  442.  
  443. #########################
  444. # retry rule for rule 0 #
  445. #########################
  446. # This is used to avoid having to always invoke rule 3 at the start of
  447. #    rule 0, as standard configurations do.  It is invoked to re-start
  448. #    parsing.
  449. S29
  450. R:$*            $:$1                remove routing debris
  451. R<@$*>:@$*        <@$1>,@$2
  452.  
  453. R$+!$+            $:$>5$1!$2            make UUCP style pure
  454.  
  455. R$*<$*>$*        $1$2$3                defocus
  456. R$+            $:$>3$1                make canonical
  457. R$+            $@$>0$1                try rule 0 again
  458.  
  459.  
  460.  
  461. ###########################
  462. # general address parsing #
  463. ###########################
  464. S0
  465.  
  466. # Handle some special cases.....
  467. R@            $#local$:$n            handle <> form
  468. R$*<@[$+]>$*        $:$1<@$[[$2]$]>$3        numeric internet spec
  469.  
  470. # Canonicalize the host name.  Detect any failures.
  471. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  472.  
  473. # If we successfully canonicalize a hostname, but the result contains
  474. # no dots, make it relative to our domain.
  475. R$*<@$->$*        $1<@$2.$D>$3
  476. R$*<$*.>$*        $1<$2>$3            drop any trailing dot
  477. R$*<$*..$Y>$*        $1<$2.$Y>$3            tidy any double dot
  478.  
  479. # now delete the local info
  480. R$+            $:$>30$1            detect local info
  481. R$*<@@$*>$*        $@$>29$1$3            remove local and retry
  482.  
  483. R<@>$*            $@$>29$1            route strip & retry
  484. R$*<@>            $@$>29$1            strip null & retry
  485.  
  486. # Hostname is now non-local and as canonical as we are going to get.
  487. # If the initial canonicalization step failed, ".FAIL" ($Y) has been
  488. # appended to the hostname.
  489.  
  490. # If the mail is destined for a known dead host, strip that host and
  491. # retry.
  492. R$*<@$=K>$*        $@$>29$1$3
  493. R$*<@$=K.$Y>$*        $@$>29$1$3            even on failures
  494.  
  495. # If the mail is destined for a host in a domain for which we are
  496. # responsible, send it directly.
  497. R$*<@$-.$=D>$*        $#ether$@$2.$3$:$1<@$2.$3>$4
  498.  
  499. # The above is true even if we failed to canonicalize.  We are supposed
  500. # to know how to deal with the message.  If we can't, who can?
  501. R$*<@$-.$=D.$Y>$*    $#ether$@$2.$3$:$1<@$2.$3>$4
  502.  
  503. # If the mail is destined for the forwarder, send it directly.
  504. R$*<@$=F>$*        $#ether$@$2$:$1<@$2>$3
  505.  
  506. # See if an MX record is available for the resulting hostname.
  507. R$*<@$+$~Y>$*        ${@$2$3$:$Y$}^$1^$2$3^$4
  508.  
  509. # Do the MX lookup even on failures since some host may choose to
  510. # advertise itself as an exchanger for some otherwise uncanonicalizable
  511. # hostname.
  512. R$*<@$+.$Y>$*        ${@$2$:$Y$}^$1^$2.$Y^$3
  513.  
  514. # If we fail to find any MX record and the address is of the form:
  515. # user@domain.for.which.we.are.responsible, strip and retry.
  516. R$Y$*^$*^$=D^$*        $@$>29$2$4
  517. R$Y$*^$*^$=D.$Y^$*    $@$>29$2$4
  518.  
  519. # See if we have to use a forwarder to mail to the exchanger.
  520. R$~Y$*^$*        $:$>31@@<@$1$2>^$3        found one!
  521. R@@<@@@$+>$*        $:@@@@$2            use the forwarder
  522. R@@<@@$+>$*        $:@@@$2                we are forwarder
  523.  
  524. # Use the appropriate mailer.
  525. R@@@@$*^$*^$*.$Y^$*    $@$>29@$F:$2@$3$4        use forwarder
  526. R@@@@$*^$*^$*^$*    $@$>29@$F:$2@$3$4
  527.  
  528. R@@@$*^$*^$*.$Y^$*    $#forgn$@$3$:$2<@$3>$4        exchanger is external
  529. R@@@$*^$*^$*^$*        $#forgn$@$3$:$2<@$3>$4
  530.  
  531. R@@$*^$*^$*.$Y^$*    $#ether$@$3$:$2<@$3>$4        exchanger is internal
  532. R@@$*^$*^$*^$*        $#ether$@$3$:$2<@$3>$4
  533.  
  534. R$Y^$*^$*^$*        $1<@$2>$3            no (or bad) MX, tidy
  535.  
  536. # If we successfully canonicalized the hostname, but couldn't find any good
  537. # MX record to tell us what to do with the message, see if we should send the
  538. # message on to a forwarder.
  539. R$*<@$*$~Y>$*        $:$>31^$1<@$2$3>$4        mark if canonical
  540. R^$*<@@@$*>$*        $@$>29@$F:$1@$2$3        send to forwarder
  541. R^$*<@@$*>$*        $#forgn$@$2$:$1<@$2>$3        we are forwarder
  542. R^$*            $:$1                unmark
  543.  
  544. # ??? unusual rule
  545. # Notice news stuffing, and stuff mail for newsgroups into a suitable script
  546. #R$*<@news-stuff.$D>    $#mailnews$:$1
  547. #R$*<@news-stuff.$D.$Y>    $#mailnews$:$1
  548.  
  549. # The message is now either to an uncanonicalizable host, or an internal
  550. # host for which no MX record exists.
  551.  
  552. # For internal hosts, see if there's an appropriate relay
  553. # machine (poor man's MX).
  554.  
  555. # If within our domain space, try "relay".addressee.domain
  556. # (even if we failed to canonicalize)
  557.  
  558. R$*<@$*$=T>$*        $:^<@$[$R.$2$T$:$Y.$2$T$]>$1^$2$T^$4
  559. R$*<@$*$=T.$Y>$*    $:^<@$[$R.$2$T$:$Y.$2$T.$Y$]>$1^$2$T.$Y^$4
  560. R^<@$Y.$-.$*$=T>$*    $:^<@$[$R.$2$T$:$Y.$1.$2$T$]>$4
  561. R^<@$Y.$-.$*$=T.$Y>$*    $:^<@$[$R.$2$T$:$Y.$1.$2$T.$Y$]>$4
  562.  
  563. R^<@$~Y$*>$*^$*^$*    $:$>30<@$1$2>$3^$4^$5
  564. R^<@$Y.$*>$*^$*^$*    $:$2<@$3>$4
  565.  
  566. R<@@$*>$*        $:<@$Y@>$2            check for self
  567.  
  568. R<@$~Y$*>$*^$*.$Y^$*    $#ether$@$1$2$:$3<@$4>$5    strip any .FAIL & bye!
  569. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  570.  
  571. R<$*>$*^$*^$*        $:$2<@$3>$4            tidy
  572.  
  573. # No appropriate relay (or relay is us). If we successfully
  574. # canonicalized and the resulting hostname is in or under our
  575. # domain, just send it directly.
  576.  
  577. R$*<@$*.$Y>$*        $:$Y^$1<@$2>$3
  578. R$~Y$*<@$*.$D>$*    $#ether$@$3.$D$:$1$2<@$3.$D>$4    bye bye
  579.  
  580. # Since we have determined that we may be the relay for the addressee domain,
  581. # see if the addressee host is actually some uncanonicalizable nickname
  582. # for ourselves (canonicalizable nicknames would have been stripped as local
  583. # info at the top of this ruleset).  If so, strip and retry.
  584.  
  585. R$Y^$*            $:$>30$1
  586. R$*<@@$*>$*        $@$>29$1$3
  587.  
  588. # All notion of "uncanonicalized" is now stripped (.FAIL removed from
  589. # addressee hostname).  See if our "uncanonicalizable" host can be found
  590. # in the UUCP maps or if a hard-coded exchanger exists.
  591.  
  592. # From UUCP host to UUCP host
  593. #    "goo.UUCP" is the "goo" in the UUCP maps, which may not be the same
  594. #    as "goo.UUX" which is the goo to which we talk directly.
  595. R$*<@$=V.$D>$*        $:@@$1<@$2.$D>$3
  596. R$*<@$=V.UUX>$*        $:@@$1<@$2.UUX>$3
  597. R$*<@$=V>$*        $:@@$1<@$2.UUX>$3
  598.  
  599. R@@$*<@$*$=N.UUX>$*    $#dom$@$3$:$1<@$2$3>$4
  600. R@@$*<@$*$=N.$+>$*    $#dom$@$3$:$1<@$2$3.$4>$5
  601. R@@$*<@$-.$+>$*        $#uucp$@$2$:$1<@$2>$4
  602.  
  603. #re-alias for dead hosts
  604. R$*<@$=K>$*        $@$>29$1$3
  605.  
  606. # ??? unusual rule
  607. # Talk to Internet forwarders.  In the absence of MX record handling
  608. #    this set of rules implement a useful kludge.  Of course, ...
  609. #R$*<@$*fozul.com>$*    $#forgn$@fozul.com$:$1<@$2fozul.com>$3
  610.  
  611.  
  612. # look for a UUCP/pathalias path to a host
  613. #    "goo.UUCP" is the "goo" in the UUCP maps, which may not be the same
  614. #    as "goo.UUX" which is the goo to which we talk directly.
  615. # ??? unusual rule
  616. #    It is not usually a good idea to send all host names through the maps.
  617. #    IMPORTANT, un-comment at most 1 of the following lines.
  618. R$+<@$->            $:^$1<@$[!$P!$2$]><@$2>
  619. #R$+!$+<@$->            $:^$1!$2<@$[!$P!$3$]><@$3>
  620. #
  621. R$+<@$-.UUCP>            $:^$1<@$[!$P!$2$]><@$2.UUCP>
  622.  
  623. R^$+<@!$P!$=V><@$+>        $@$>29$1@$2
  624. R^$+<@!$P!$-><@$+>        $:$1<@$3>
  625.  
  626. # if UUCP resolution succeeds, start over
  627. R^$+<@$+><@$+>            $@$>29$2!$1
  628.  
  629. # resolve unknown UUCP domains with pathalias
  630. R$+<@$+.UUCP>            $:^$1<@$2><$[!$P!$2$]>
  631. R^$+<@$+><!$P!$*.$D>        $@$>29$1@$2        recognize LOCAL.uucp
  632. R^$+<@$+><!$P!$*>        $:$1<@$2.UUCP>
  633. R^$+<@$+><$*>            $@$>29$3!$2!$1        use generated path
  634.  
  635. # resolve unknown domains with pathalias
  636. R$*<@$+.$+>$*            $:^$1<@$2.$3><$[!$P!$2.$3$]>$4
  637. R^$*<@$+><!$P!$*>$*        $:$1<@$2>$4
  638. R^$*!$*<@$+><$=N>        $@$>29$4!$3!$1!$2    domain to good neighbor
  639. R^$*!$*<@$+><$=N!$+>        $@$>29$4!$3!$1!$2
  640. R^$+<@$+><$=N>            $@$>29@$3:$1@$2
  641. R^$+<@$+><$=N!$+>        $@$>29@$3:$1@$2
  642. R^<@$+><$+!$+>$+        $@$>29@$2:@$1$4        use generated path
  643. R^<@$+><$+>$+            $@$>29@$2:@$1$3
  644. R^$+<@$+><$+>            $@$>29$3!$2!$1
  645. # we cannot convert nasty stuff--where do the !'s go?
  646. R^$*<@$+><$*>$*            $:$1<@$2>$4
  647.  
  648. # O.K.  I give up!  Send this message to someone wiser.
  649.  
  650. # See if we need to use a forwarder.
  651. R$*<@$*>$*        $:$>31$1<@$2>$3
  652. R$*<@@@$*>$*        $@$>29@$F:$1@$2$3        send to forwarder
  653. R$*<@@$*>$*        $#forgn$@$2$:$1<@$2>$3        we are forwarder
  654.  
  655. # Destination is internal.  Try "relay".our.domain
  656. R$*<@$*>$*        $:$>30<@$[$R.$D$:$Y$]>$1^$2^$3
  657. R<@@$*>$*        $:<@$Y@>$2            check for self
  658. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  659. R<$*>$*^$*^$*        $:$2<@$3>$4            tidy
  660.  
  661. # Message is rated PG (Parental Guidance suggested)...
  662. # First, determine our domain's location relative to the top level.
  663. R$*<@$*>$*        $:$D^$1^$2^$3
  664. R$*$=T^$*        $:$1^$3
  665. R$*.^$*            $:$1^$2
  666.  
  667. # If our domain isn't the top domain, try and send this message
  668. # to "relay".our.parent.domain
  669. R$+.$+^$*        $:$>30<@$[$R.$2$T$:$Y$]>$1.$2^$3
  670. R<@@$*>$*        $:<@$Y@>$2            check for self
  671. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  672. R<$*>$*^$*        $:$2^$3
  673. R$+^$*            $:$>30<@$[$R.$T$:$Y$]>$1^$2
  674. R<@@$*>$*        $:<@$Y@>$2            check for self
  675. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  676. R<$*>$*^$*        $:$2^$3
  677.  
  678. # If the top domain isn't our domain, or our immediate parent domain,
  679. # try and send this message to "relay".top.domain
  680. R$+.$+^$*        $:$>30<@$[$R.$T$:$Y$]>$1.$2^$3
  681. R<@@$*>$*        $:<@$Y@>$2            check for self
  682. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  683.  
  684. # Try just "relay"
  685. R<$*>$*            $:$2
  686. R$*^$*^$*^$*        $:$2^$3^$4
  687. R$*^$*^$*        $:$>30<@$[$R$:$Y$]>$1^$2^$3
  688. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  689. R<$*>$*^$*^$*        $:$2<@$3>$4
  690. R^$*^$*^$*        $:$1<@$2>$3
  691.  
  692. # Send completely unknown stuff to the forwarder.
  693. R$*<@$*>$*        $:$>30<@$F>$1^$2^$3
  694. R<@@$*>$*        $:<@$Y@>$2            check for self
  695. R<@$~Y$*>$*^$*^$*    $@$>29@$F:$3@$4$5        bye bye!
  696. R<$*>$*^$*^$*        $:$1<@$2>$3
  697.  
  698. # Drat!  Not much else we can do! 
  699. # Complain about unknown machines and domains
  700. R$*<@$*>$*        $#ether$@$2$:$1<@$2>$3        BOING!?!?
  701.  
  702. # everything else must be a local name or alias
  703. R$*            $#local$:$1
  704.  
  705. ################################
  706. # convert to UUCP style routes #
  707. ################################
  708. S5
  709. R$*<$+>$*        $1$2$3            defocus
  710. R@$+:@$+:$+        @$1,@$2:$3        <route-addr> canonical
  711. R@$+,@$+        @$1!$2            @a,@b:user@c to @a!b:user@c
  712. R@$+:$+@$+        $:$1!$3!$2        @a!b:user@c to a!b!c!user
  713. R$+@$+            $2!$1            simple domain address
  714.  
  715. R$-.UUCP!$+        $1!$2
  716. R$-.UUX!$+        $1!$2
  717.  
  718.  
  719. ########################
  720. # strip internal paths #
  721. ########################
  722. S7
  723. R$*            $:$>5$1                convert to UUCP style
  724.  
  725. # remove our name for mailers which will add our hostname in any case
  726. R$=w!$+            $@$>7$2
  727. R$j!$+            $@$>7$1
  728.  
  729.  
  730. ##################################
  731. # resolve unknown UUCP addresses #
  732. ##################################
  733. S8
  734. R$*<@$*$D>$*            $@$1<@$2$D>$3        recognize our domain
  735. R$*<@$=w.UUCP>$*        $@$1<@$2.UUCP>$3
  736.  
  737. R$*<@$=V.UUCP>$*        $@$1<@$2.UUCP>$3    notice our modems
  738.  
  739. R$*                $:$w!$1            prepend "ourself!"
  740. R$~F!$*                $@$2            quit if not a forwarder
  741. R$~F.$+!$*            $@$3
  742. R$+!$*                $:$2
  743.  
  744. # look for a path to a host
  745. R$*<@$-.UUCP>            $:!!$1<@$[!$P!$2$]>
  746. R!!$*<@!$P!$->            $@$1<@$2.UUCP>
  747. R!!$*<@$*>            $@$2!$1            use generated path
  748.  
  749. # resolve unknown UUCP domains
  750. R$*<@$+.UUCP>            $:!!$1<@$2><$[!$P!$2$]>
  751. R!!$*<@$+><!$P!$+>        $@$1<@$2.UUCP>
  752. R!!$*<@$+><$+>            $@$3!$2!$1        use generated path
  753.  
  754. # resolve unknown domains
  755. R$*<@$+.$+>            $:!!$1<@$2.$3><$[!$P!$2.$3$]>
  756. R!!$*<@$+><!$P!$*>        $@$1<@$2>
  757. R!!<@$+><$+>            $@$2!$1
  758. R!!$+<@$+><$+>            $@$3!$2!$1
  759.  
  760.  
  761. ############################################################
  762. ############################################################
  763. #    Useful utilities
  764. ############################################################
  765. ############################################################
  766.  
  767. # S30 - Detect our hostname
  768. # If the hostname in focus is us, mark it by doubling the "@"
  769. # if so.
  770. S30
  771. # Find other names for ourself.
  772. #    XXX this should be handled in the $=w macro
  773. #R$*<@alternatename.foo.com>$*    $@$1<@@$j>$2
  774.  
  775. R$*<@>$*        $@$1<@@>$2            null host is thishost
  776. R$*<@$=w>$*        $@$1<@@$2>$3            thishost
  777. R$*<@$j>$*        $@$1<@@$j>$3            even if it has dots
  778.  
  779. # ??? - unusual rule
  780. # Uncomment the following lines if you don't have a wildcard MX record for
  781. # the LOCAL domain and if you want to treat foo@LOCAL as foo@THISHOST.
  782. #R$*<@$D>$*        $@$1<@@$D>$2            LOCAL
  783. #R$*<@.$D>$*        $@$1<@@.$D>$2            .LOCAL
  784.  
  785. R$*<@$=w.UUCP>$*    $@$1<@@$2.UUCP>$3        thishost.UUCP
  786. R$*<@$j.UUCP>$*        $@$1<@@$j.UUCP>$2
  787.  
  788. # S31 - See if we should use the forwarder
  789. # Return with the "@" in front of the focused host modified as follows:
  790. #    unchanged - host is internal, use of forwarder should be unnecessary.
  791. #    @ -> @@   - host is external and we are the forwarder or forwarder
  792. #            loop detected.
  793. #    @ -> @@@  - host is external and we are not the forwarder.
  794. S31
  795. R$*<@$*$=T>$*        $@$1<@$2$T>$4            not external
  796. R$*            $:$>30<@$F>$1
  797. R<@@$*>$*<@$*>$*    $@$2<@@$3>$4            we're the forwarder
  798. R<@$*>$*<@$=F>$*    $@$2<@@$3>$4            forwarder loop, send!
  799. R<@$*>$*<@$*>$*        $@$2<@@@$3>$4            send to forwarder!
  800.  
  801. ############################################################
  802. ############################################################
  803. #####
  804. #####        Local and Program Mailer specification
  805. #####
  806. ############################################################
  807. ############################################################
  808.  
  809. Mlocal, P=/bin/mail, F=EDFMlsmhu, S=10, R=20, A=mail -s -d $u
  810. Mprog,    P=/bin/sh,   F=lsDFMe, S=10, R=20, A=sh -c $u
  811.  
  812. S10
  813. R$+!$+            $:$>7$1!$2            clean UUCP style
  814. R$*<@$j>        $@$1
  815. R$*<@$=w>        $@$1
  816. R$*<@$=w.$D>        $@$1
  817. R$*<@$-.$D>        $1<@$2>
  818.  
  819. S20
  820. R$+!$+            $:$>7$1!$2            clean UUCP style
  821. R$*<@$j>        $@$1
  822. R$*<@$=w>        $@$1
  823. R$*<@$=w.$D>        $@$1
  824. R$*<@$-.$D>        $1<@$2>
  825. R$*<@>            $@$1
  826.  
  827.  
  828. ############################################################
  829. ############################################################
  830. #####
  831. #####        Ethernet Mailer specification
  832. #####
  833. ############################################################
  834. ############################################################
  835.  
  836. Mether,    P=[IPC], F=mDFMhuXC, S=11, R=21, E=\r\n, A=IPC $h
  837.  
  838. S11
  839. # Canonicalize any hostname.  Mark failures.
  840. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  841.  
  842. # If successfully canonicalize to single-token hostname, make relative
  843. # to our local domain.
  844. R$*<@$->$*        $:$1<@$2.$D>$3
  845.  
  846. # Tidy up a bit.
  847. R$*<@$+.$Y>$*        $:$1<@$2>$3        strip any .FAIL
  848. R$*<@$+.>$*        $1<@$2>$3        strip any trailing dot(s)
  849.  
  850. # ??? unusual rule
  851. # Try and match the whole gory thing in the reverse aliases map.
  852. # Also see OKA database definition above.
  853. #R$*            $:^$1
  854. #R^$*<@$*>$*        $:$(A$1@$2$3$:$1<@$2>$3$)
  855. #R^$+            $:$(A$1$:$1$)
  856.  
  857. R$+!$+            $:$>7$1!$2        clean UUCP style
  858. R$-<@$=V>        $2!$1            convert UUCP neighbors
  859. R$+!$+            $:$w!$1!$2        tack on our hostname
  860. R$+!$+            $@$>5$1!$2
  861. R$*<@$+>$*        $@$1<@$2>$3
  862. R$+            $@$1<@$j>
  863.  
  864. S21
  865. R$+!$+            $@$>5$1!$2        make UUCP style pure
  866. R$+<@[$+]>        $@$1<@[$2]>        pass IP numbers
  867.  
  868. # Canonicalize any hostname.  Mark failures.
  869. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  870.  
  871. # If successfully canonicalize to single-token hostname, make relative
  872. # to our local domain.
  873. R$*<@$->$*        $:$1<@$2.$D>$3
  874.  
  875. # Tidy up a bit.
  876. R$*<@$+.$Y>$*        $:$1<@$2>$3        strip any .FAIL
  877. R$*<@$+.>$*        $1<@$2>$3        strip any trailing dot(s)
  878.  
  879. R$-<@$=V>        $@$>5$1<@$2>        convert UUCP short hand
  880. R$-            $:$1<@$j>
  881.  
  882.  
  883. ############################################################
  884. ############################################################
  885. #####
  886. #####        UUCP Mailer specifications
  887. #####
  888. ############################################################
  889. ############################################################
  890.  
  891.  
  892. # Domain UUCP, which can take >1 destination per transaction, and understands
  893. #    domains.  These guys like 'remote from' lines, unlike ethernet users.
  894. Mdom, P=/usr/bin/uux, F=sDFMhumUC, S=13, R=23, A=uux - $h!rmail ($u)
  895.  
  896. S13
  897. R$*<@$-.UUCP>        $:$>7$1<@$2.UUCP>
  898. R$*            $:$>11$1
  899. R$-.$D!$+        $1!$2            remove our domain if UUCP
  900.  
  901. S23
  902. R<@$+>$+        $:$>5<@$1>$2        822 route to UUCP route
  903. R$*<@$-.UUCP>        $:$>5$1<@$2.UUCP>
  904. R$*<@$-.UUX>        $:$>5$1<@$2.UUCP>
  905. R$*            $@$>21$1
  906.  
  907.  
  908. # dumb UUCP to the great, outside world
  909. #    Notice we assume they can handle >1 addressee / msg
  910. Muucp, P=/usr/bin/uux, F=sDFMhumUC, S=14, R=24, A=uux - $h!rmail ($u)
  911.  
  912. S14
  913. R$*            $:$>7$1            convert to UUCP style
  914. R$*            $:$w!$1            add gateway name
  915. R$-.$D!$+        $1!$2            remove our domain
  916.  
  917. S24
  918. R$+            $:$>8$1            resolve uucp hosts
  919. R$*            $:$>5$1            convert to UUCP style
  920.  
  921.  
  922.  
  923. ############################################################
  924. ############################################################
  925. #####
  926. #####        Usenet 'Mailer' specification
  927. #####
  928. ############################################################
  929. ############################################################
  930.  
  931. # ??? unusual rule
  932. # stuff news articles into local news groups
  933. Mmailnews, P=/usr/lib/news/mailnews, F=lsDFemC, S=15, R=25, A=mailnews $u
  934.  
  935. S15
  936. R$+!$+            $:$>7$1!$2            clean UUCP style
  937.  
  938. S25
  939. R$+!$+            $:$>7$1!$2            clean UUCP style
  940.  
  941.  
  942.  
  943. ############################################################
  944. ############################################################
  945. #####
  946. #####        Foreign TCP/SMTP Mailer specification
  947. #####
  948. ############################################################
  949. ############################################################
  950.  
  951. # This is the same as the local ethernet mailer.
  952. Mforgn,    P=[IPC], F=mDFMhuXC, S=16, R=21, E=\r\n, A=IPC $h
  953.  
  954. S16
  955. R$*            $:$>11$1    same as normal ethernet
  956.  
  957. # ??? unusual rule
  958. # Rewrite From: lines to hide internal domains (the infamous "%-hack".)
  959. #R$-<@$j>        $@$1<@$j>
  960. #R$-<@$+.$D>        $@$1%$2.$D<@$j>
  961. #R$-<@$+.$D>        $@$1%$2<@$D>
  962.  
  963.  
  964. #S26
  965. #R$*            $@$>21$1    same as normal ethernet
  966.  
  967.